Page({
  data: {},
  onLoad: function (options) {
    this.yunxin()
  },
  dianji:function(){
    this.yunxin()//调用回调函数
  },
  yunxin:function(){
    var that = this;
    that.rili = that.selectComponent("#rili")
    var starTime = ''
    var day = ''
    var endTime = ''
    that.rili.xianShi({
      data: function (res) {
        // console.log(res)//日期
        if (res!=null){
          if (res.length == 1) {
            starTime = res[0].data
          }
          else if (res.length == 2) {
            starTime = res[0].data
            endTime = res[1].data
            day = res[1].chaDay
          }
        }
        else{
          starTime = ''
          day = ''
          endTime = ''
        }
        that.setData({
          starTime: starTime,
          endTime: endTime,
          day: day,
        })
      }
    })
  },
  
})